package work;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ConfigWork {

    @Bean
    public Worker w1(){
        Worker w=new Worker();
        w.setName("猪八戒");
        w.setAge(800);
        return w;
    }

    @Bean
    public Worker w2(){
        Worker w=new Worker();
        w.setName("沙和尚");
        w.setAge(600);
        return w;
    }



}
